package com.neuedu.his.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neuedu.his.entity.Drugs;
import com.neuedu.his.service.DrugsService;


@RestController
@RequestMapping("/drugs")
public class DrugsController {

	@Autowired
	private DrugsService service;
	
	@RequestMapping("/selectAll")
	// http://localhost:8088/drugs/selectAll
	public List<Drugs> selectAll(Drugs u) {
		return service.selectAll(u);
	}
	
	@RequestMapping("/selectById")
	// http://localhost:8088/drugs/selectById?id=5
	public Drugs selectById(Drugs u) {
		return service.selectById(u);
	}
	
	@RequestMapping("/selectOnlyDrugsName")
	// http://localhost:8088/drugs/selectOnlyDrugsName?DrugsCode=869794
	public List<Drugs> selectOnlyDrugsName(Drugs u) {
		return service.selectOnlyDrugsName(u);
	}
}
